package com.lksoft.bz.command;

import com.lksoft.bz.BeadUsage;
import com.lksoft.bz.Bz;

/**
 * SetLetter Command
 * 
 * @author Lake
 *
 */
public class SetLetterCommand implements Command {
	
	private Bz bz;
	private BeadUsage beadUsage;
	private char from;
	private char to;
	
	public SetLetterCommand(Bz bz, BeadUsage beadUsage, char from, char to){
		this.bz = bz;
		this.beadUsage = beadUsage;
		this.from = from;
		this.to = to;
	}

	@Override
	public void redo() {
		beadUsage.setLetter(to);
		bz.redraw();
	}

	@Override
	public void undo() {
		beadUsage.setLetter(from);
		bz.redraw();
	}

}
